package com.demo.controller;

import java.util.List;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.demo.service.PayService;
import com.demo.domain.entity.Pay;




/**
 * PayController
 *
 * @author wu
 * @date ${datetime}
 */
@RestController
@RequestMapping("/pay")
@Tag(name = "充值明细表管理")
class PayController {
    @Autowired
    private PayService payService;

    /**
     * 查询Pay列表
     */
    @GetMapping("/list")
    @Operation(summary = "获取充值明细表列表")
    public List<Pay> findAll(){
        return payService.findAll();
        }



    /**
     * 获取Pay详细信息
     */
    @GetMapping("/{id}")
    @Operation(summary = "获取充值明细表详细信息")
    public Pay findOne(@PathVariable Long id){
        return payService.findOne(id);
        }

    /**
     * 新增Pay
     */
    @PostMapping("/add")
    @Operation(summary = "新增充值明细表")
    public boolean save(@RequestBody Pay pay){
        return payService.add(pay);
        }


/**
     * 修改Pay
     */
    @PostMapping("/update")
    @Operation(summary = "修改充值明细表")
    public boolean edit(@RequestBody Pay pay){
        return payService.update(pay);
    }

    /**
     * 删除Pay
     */
	@GetMapping("del/{id}")
    @Operation(summary = "删除充值明细表")
    public boolean remove(@PathVariable Long id){
        return payService.deleteByid(id);
    }
}
